#!/bin/bash
# Author: gongyunxiang
# Pack Tools Script 
# Version: 0.9
# time 2017年4月1日14:42:57

ROOT=$(cd `dirname $0`; pwd)"/"
env=$1

rm -rf $ROOT/doc $ROOT/etc $ROOT/data 
mv  $ROOT/webroot/* $ROOT
rm -rf $ROOT/application/config

if [ "$env" == "test" ] ;then
	cmd=$cmd"mv $ROOT/application/config_test $ROOT/application/config;"
elif [ "$env" == "uat" ] ;then
	cmd=$cmd"mv $ROOT/application/config_uat $ROOT/application/config;"
else
	cmd=$cmd"mv $ROOT/application/config_prod $ROOT/application/config;"
fi
cmd=$cmd"cd $ROOT/application; rm -rf $ROOT/application/config_load $ROOT/application/config_prod $ROOT/application/config_uat $ROOT/application/config_test $ROOT/webroot ;"

eval "$cmd"



